package adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.AllRankingBean;
import bean.CourseraInfoBean;
import bean.IndexBean;
import student.andlei.com.student.R;
import utils.GlideUtils;
import utils.StringUtils;


public class AllRankingAdapter extends BaseQuickAdapter<IndexBean.ClassRank,BaseViewHolder> {
    private Context context;
    public AllRankingAdapter(Context context, int layoutResId, @Nullable List data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, IndexBean.ClassRank item) {
        helper.setText(R.id.tv_name,item.student_name);
//        if(!StringUtils.isNull(item.rownum)&&!item.rownum.equals("-")){
//            helper.setText(R.id.tv_paiming,"第"+Integer.parseInt(item.rownum)+"名");
//        }else {
            helper.setText(R.id.tv_paiming,"第"+item.rownum+"名");
//        }

        GlideUtils.loadImageViewHeadphotoLoding(context,item.head_image, (ImageView) helper.getView(R.id.cimg_photo));
    }


}
